package net.jforum.entities;

import java.util.Comparator;

/**
 * @ author  张洋 jackson.zhang@ericsson.com
 * @ version 创建时间 ：Aug 8, 2010  2:20:07 PM
 * @ description : 
 */
public class TopicVirtueStickyComparator implements Comparator{
	public int compare(Object o1, Object o2)
	{
		Topic t1 = (Topic)o1;
		Topic t2 = (Topic)o2;
		
		if(t1.getTopicvirtueForumSticky()<t2.getTopicvirtueForumSticky()){
			return 1;
		}else if(t1.getTopicvirtueForumSticky()==t1.getTopicvirtueForumSticky()){
				return t2.getLastPostDate().compareTo(t1.getLastPostDate());
		}
		return -1;

	}
}
